package com.cy.pj.eiems.dao;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.cy.pj.eiems.entity.Question;
import com.cy.pj.eiems.entity.Score;



@Mapper
public interface SysExamDao {

	/**
	 * 根据随机产生的id们获取数据
	 * @return
	 */
	List<Question> findQuestions(@Param("ids")Integer[] Ids);

	/**
	 * 获取表中数据数量
	 */
	int getCountofQuestions();

	/**
	 * 存成绩
	 * null,#{username},#{knowlegPoint},#{score},now()
	 * id,username,score,submitTime
	 * insert into score(id,student_username,score,submitTime) values(null,#{student_username},#{score},now())
	 */
	int insertScores(
			@Param("student_username") String username,
			@Param("score") Integer score
			);

	/**
	 * 写入错题库
	 * (搁浅)json问题
	 */
	//	int insertWrongQuestionIds(
	//			@Param("user_name")String username, 
	//			@Param("question_id")Integer wrongResults,
	//			@Param("submitResult")String wrongChoices
	//			);

	/**
	 * 查询score表中所有对象并展现
	 */
	List<Score> findPageObjects(
			@Param("student_username")String  student_username,
			@Param("startIndex")Integer startIndex,
			@Param("pageSize")Integer pageSize);
	/**
	 * 查询总记录的数量
	 */
	int getRowCount(@Param("student_username") String student_username);

}
